% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/latlon_as.numeric.R
\name{latlon_as.numeric}
\alias{latlon_as.numeric}
\title{Strip non-numeric characters from a vector}
\usage{
latlon_as.numeric(x)
}
\arguments{
\item{x}{vector of something that is supposed to be numbers like latitude or longitude
and may be a character vector because there were some other characters like tab or space or percent sign or dollar sign}
}
\value{
numeric vector same length as x
}
\description{
Remove all characters other than minus signs, decimal points, and numeric digits
}
\details{
Useful if latitude or longitude vector has spaces, tabs, etc.
CAUTION - Assumes stripping those out and making it numeric will fix whatever problem there was
and end result is a valid set of numbers. Inf etc. are turned into NA values.
Empty zero length string is turned into NA without warning. NA is left as NA.
If anything other than empty or NA could not be interpreted as a number, it
returns NA for those and offers a warning.
}
\examples{
  
  latlon_as.numeric(c("-97.179167000000007", " -94.0533", "-95.152083000000005"))
  latlon_as.numeric(-3:3)
  latlon_as.numeric(c(1:3, NA))
  latlon_as.numeric(c(1, 'asdf'))
  latlon_as.numeric(c(1, ''))
  latlon_as.numeric(c(1, '', NA))
  latlon_as.numeric(c('aword', '$b'))
  latlon_as.numeric(c('-10.5\%', '<5', '$100'))
  latlon_as.numeric(c(Inf, 1))

}
\seealso{
latlon_df_clean() latlon_infer() latlon_is.valid() latlon_as.numeric()
}
\keyword{internal}
